Skip to content

Conversation

Rjiegit
Copy link

@Rjiegit Rjiegit commented Jul 30, 2021

No description provided.

Comment on lines +1 to +10
<?php

namespace App\Http;

class Status
{
public const OK = 200;
public const ERROR = 500;
public const UPDATED = 201;
}
Copy link

@agus24 agus24 Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need to create enum class. you can use Symfony\Component\HttpFoundation\Response
Response::HTTP_OK will return 200
Response::HTTP_CREATED will return 201
Response::HTTP_NOT_FOUND will return 404
Response::HTTP_INTERNAL_SERVER_ERROR will return 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants